<%-- 
    Document   : search_visit_detail
    Created on : Nov 5, 2013, 10:25:31 PM
    Author     : Mansur
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>.: Ship Visit :.</title>    
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.blockUI.js"></script>   
        <script type="text/javascript">
            function popupWinView(id) {
                var url = '${pageContext.request.contextPath}/shipVisitFlow?viewDoc&idVisit=' + id;
                var left = (screen.width/2)-(1000/2);
                var top = (screen.height/2)-(1000/2);                
                var params = 'width=1000';
                params += ', height=1000';
                params += ', top=' + top;
                params += ', left=' + left;
                //params += ', fullscreen=yes';
                params += ', directories=no';
                params += ', location=no';
                params += ', menubar=no';
                params += ', resizable=no';
                params += ', scrollbars=yes';
                params += ', status=no';
                params += ', toolbar=no';                
                newwin = window.open(url, 'PopUp', params);
                if (window.focus) {
                    newwin.focus();
                }                
                return false;
            }
            
            function unblockUI() {
                $.unblockUI();
            }
            
            function blockUI () {
                $.blockUI();
            }
        </script>
        <style>
            .validateTips { border: 1px solid transparent; padding: 0.3em; color: red; font-weight: bold}
        </style>
    </head>
    <body>
        <s:useActionBean beanclass="exatrez.stripes.util.ListUtil" var="list"/>
        <s:useActionBean beanclass="exatrez.stripes.util.ShipVisitListUtil" var="visitlist"/>
        <s:form beanclass="exatrez.stripes.action.ShipVisitFlowAction" name="form1">
            <s:hidden name="staffId" />
            <s:hidden name="currentYear" />
            <s:hidden name="status" />
            <div>
                <fieldset>
                    <div id="page-title">
                        <span class="title">Ship Visit</span>
                    </div>
                    <s:messages/>
                    <s:errors/>
                    <table border="0" align="center" width="50%">
                        <tr>
                            <td style="vertical-align: top; text-align: left;" colspan="7">
                                <s:submit name="searchStaffVisit" value="Back" class="btn" />
                            </td>
                        </tr>
                        <tr>
                            <td width="25%" style="vertical-align: top; text-align: right;"><b>Staff ID</b></td>
                            <td width="1%" style="vertical-align: top; text-align: left;"><b>:</b></td>
                            <td width="23%" style="vertical-align: top; text-align: left;">
                                ${actionBean.userSelect.userId}&nbsp;
                            </td>
                            <td width="5%" style="vertical-align: top; text-align: left;">&nbsp;</td>
                            <td width="25%" style="vertical-align: top; text-align: right;"><b>Department</b></td>
                            <td width="1%" style="vertical-align: top; text-align: left;"><b>:</b></td>
                            <td width="23%" style="vertical-align: top; text-align: left;">
                                ${actionBean.userSelect.department.departmentName}&nbsp;
                            </td>
                        </tr>
                    </table>
                    
                    <div id="page-title">
                        <span class="title">History Ship Visited as per year ${actionBean.currentYear} for status ${actionBean.statusDesc}</span>
                    </div>
                    <div style="align: center">
                        <display:table class="tablecloth" name="${actionBean.listStaffStatusDetails}" requestURI="/shipVisitFlow?searchStaffVisitDetail" id="line" style="width:100%">
                            <display:column title="No." sortable="true"><center>${line_rowNum}.</center></display:column>
                            <display:column title="Vessel Name" sortable="true" >
                                <a href="shipVisitFlow?staffDetailCoo&idVisit=${line.shipVisitFlowId}">${line.vessel.vesselName}</a>
                            </display:column>
                            <display:column title="Date Visit" sortable="true" ><fmt:formatDate value="${line.dateVisit}" pattern="dd/MM/yyyy"/></display:column>
                            <display:column title="Location" sortable="true" property="location"/>        
                            <%--<display:column title="Summary / Comments" sortable="true" property="summary"/>--%>
                            <display:column title="Attachment" >
                                <c:if test="${!empty(line.listFilteredFile)}" >
                                    <a href="#" onclick="popupWinView('${line.shipVisitFlowId}');return false;">View</a>
                                </c:if>
                            </display:column>
                            <display:column title="Date Submit" sortable="true"><fmt:formatDate value="${line.infoAudit.createDate}" pattern="dd/MM/yyyy hh:mm:ss a"/></display:column>
                            <c:if test="${actionBean.statusDesc eq 'Approved'}">
                                <display:column title="Approved By" sortable="true" property="verifierId.userId"/>
                            </c:if>
                            <c:if test="${actionBean.statusDesc eq 'Rejected'}">
                                <display:column title="Rejected By" sortable="true" property="verifierId.userId"/>
                            </c:if>
                            <display:column title="Comment" sortable="true" property="rejectNote" style="width:250px;" />
                        </display:table>
                    </div>
                </fieldset>
            </div>
            <div>
                <fieldset>
                    <s:submit name="searchStaffVisit" value="Back" class="btn" />
                </fieldset>
            </div>
        </s:form>
    </body>
</html>
